package com.Test.service;

import java.sql.*;

public class user {
    private static final String DRIVER_NAME="com.mysql.jdbc.Driver";
    private static final String URL ="jdbc:mysql://localhost:3306/user";
    private static final String USER_NAME ="root";
    private static final String PASSWORD ="123456";

    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Connection connection = null;
        Class.forName(DRIVER_NAME);
        connection = DriverManager.getConnection(URL,USER_NAME,PASSWORD);

        String sql = "  SELECT * FROM article";
        PreparedStatement prst = connection.prepareStatement(sql);
        ResultSet rs = prst.executeQuery();

        Number userid = rs.getInt("userid");
        String name = rs.getString("name");
        String email = rs.getString("email");
        String headimg = rs.getString("headimg");
        Boolean Super = rs.getBoolean("super");
        Boolean active = rs.getBoolean("active");
}}
